//
//  ProductionCell.m
//  GameBoss
//
//  Created by 张艺 on 15/4/30.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "ProductionCell.h"

#define CELLSIZE [UIScreen mainScreen].bounds.size

@implementation ProductionCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.view = [[UIView alloc] initWithFrame:CGRectMake(CELLSIZE.width * 10/375, CELLSIZE.height * 5/667, CELLSIZE.width - CELLSIZE.width * 20/375, CELLSIZE.height * 84/667)];
        self.view.layer.cornerRadius = 5;
        [self.contentView addSubview:self.view];
        [_view release];
        
        self.picImageView = [[UIImageView alloc] initWithFrame:CGRectMake(CELLSIZE.width / 32 , (CELLSIZE.width / 4 - CELLSIZE.width / 5 ) / 2, CELLSIZE.width / 4, CELLSIZE.width / 5)];
        [self.view addSubview:self.picImageView];
        [_picImageView release];
        
        self.title = [[UILabel alloc] initWithFrame:CGRectMake(CELLSIZE.width / 4  + CELLSIZE.width / 16, 0, CELLSIZE.width / 4 * 3 - 30 * Screen.width / 375, 30 * Screen.height / 667)];
        [self.view addSubview:self.title];
        [_title release];
        
        self.price = [[UILabel alloc] initWithFrame:CGRectMake(CELLSIZE.width / 4 + CELLSIZE.width / 16, 30 * Screen.height / 667, CELLSIZE.width / 4 * 3, 30 * Screen.height / 667)];
        self.price.textColor = [UIColor redColor];
        [self.view addSubview:self.price];
        [_price release];
        
        self.mainType = [[UILabel alloc] initWithFrame:CGRectMake(CELLSIZE.width / 2, 20 * Screen.height / 667, CELLSIZE.width / 4 * 3, 50 * Screen.height / 667)];
        [self.view addSubview:self.mainType];
        self.mainType.font = [UIFont systemFontOfSize:12];
        [_mainType release];
        
        self.typeValue = [[UILabel alloc] initWithFrame:CGRectMake(CELLSIZE.width / 2 + CELLSIZE.width / 5, 20 * Screen.height / 667, CELLSIZE.width / 4 , 50 * Screen.height / 667)];
        [self.view addSubview:self.typeValue];
        self.typeValue.font = [UIFont systemFontOfSize:12];
        [_typeValue release];
        
        self.otherType = [[UILabel alloc] initWithFrame:CGRectMake(CELLSIZE.width / 2, 50 * Screen.height / 667, CELLSIZE.width / 4, 30 * Screen.height / 667)];
        [self.view addSubview:self.otherType];
        self.otherType.font = [UIFont systemFontOfSize:12];
        [_otherType release];
        
        self.otherTypeValue = [[UILabel alloc] initWithFrame:CGRectMake(CELLSIZE.width / 2 + CELLSIZE.width / 5, 50 * Screen.height / 667, CELLSIZE.width / 4, 30 * Screen.height / 667)];
        [self.view addSubview:self.otherTypeValue];
        self.otherTypeValue.font = [UIFont systemFontOfSize:12];
        [_otherTypeValue release];

    }
    return self;
}

#pragma mark 选取白黑两种模式
- (void)setNightDayModel {
    [NightManager setBackgroundColorWithView:self.contentView];
    [NightManager setViewColorWithView:self.view];
    [NightManager setLabelColorWithLabel:self.title];
    [NightManager setLabelColorWithLabel:self.mainType];
    [NightManager setLabelColorWithLabel:self.typeValue];
    [NightManager setLabelColorWithLabel:self.otherType];
    [NightManager setLabelColorWithLabel:self.otherTypeValue];
}

- (void)setLightDayModel {
    [NightManager setBackgroundColorWithView:self.contentView];
    [NightManager setViewColorWithView:self.view];
    [NightManager setLabelColorWithLabel:self.title];
    [NightManager setLabelColorWithLabel:self.mainType];
    [NightManager setLabelColorWithLabel:self.typeValue];
    [NightManager setLabelColorWithLabel:self.otherType];
    [NightManager setLabelColorWithLabel:self.otherTypeValue];
    
}

- (void)dealloc
{
    [_picImageView release];
    [_title release];
    [_price release];
    [_mainType release];
    [_typeValue release];
    [super dealloc];
}


@end
